const Base = require('./base.js');
module.exports = class extends Base {
  __before() {
    super.__before();
    this.adService = think.rpc.platform.platformAd;
  }
  /**
   * 获取banner
   * type:类型
   * 最多5个banner
   */
  async dataAction() {
    // 渠道类型 channel_ids 待定
    const adTypeId = this.intVal('type', 1);
    const data = await this.adService.queryData({
      page: 1,
      limit: 5,
      adTypeId,
      title: this.strVal('title'),
      order: 'sort desc',
      field: 'link,cover,title,channel_ids',
      platformId: think.platformId
    });
    return this.success(data);
  }
};
